load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "mononoke_types",
    srcs = glob(["src/**/*.rs"]),
    named_deps = {
        "bincode": "fbsource//third-party/rust:bincode-2",
    },
    test_deps = [
        "fbsource//third-party/rust:crossbeam",
        "fbsource//third-party/rust:paste",
        "fbsource//third-party/rust:pretty_assertions",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:tokio",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/blobstore:memblob",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:ascii",
        "fbsource//third-party/rust:async-recursion",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:bit-set",
        "fbsource//third-party/rust:blake2",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:chrono",
        "fbsource//third-party/rust:chrono-english",
        "fbsource//third-party/rust:derivative",
        "fbsource//third-party/rust:either",
        "fbsource//third-party/rust:faster-hex",
        "fbsource//third-party/rust:fn-error-context",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:gix-date",
        "fbsource//third-party/rust:gix-hash",
        "fbsource//third-party/rust:gix-object",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:lazy_static",
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:nonzero_ext",
        "fbsource//third-party/rust:quickcheck",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_derive",
        "fbsource//third-party/rust:sha1",
        "fbsource//third-party/rust:smallvec",
        "fbsource//third-party/rust:strum",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:vec_map",
        "//common/rust/shed/borrowed:borrowed",
        "//common/rust/shed/bounded_traversal:bounded_traversal",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/quickcheck_arbitrary_derive:quickcheck_arbitrary_derive",
        "//common/rust/shed/sorted_vector_map:sorted_vector_map",
        "//common/rust/shed/sql:sql",
        "//eden/mononoke/blobstore:blobstore",
        "//eden/mononoke/common/futures_watchdog:futures_watchdog",
        "//eden/mononoke/common/thrift_convert:thrift_convert",
        "//eden/mononoke/derived_data/if:derived_data_type_if-rust",
        "//eden/mononoke/lfs_protocol:lfs_protocol",
        "//eden/mononoke/mononoke_types/serialization:mononoke_types_serialization-rust",
        "//eden/mononoke/server/context:context",
        "//eden/scm/lib/edenapi/types:edenapi_types",
        "//eden/scm/lib/xdiff:xdiff",
        "//thrift/lib/rust:fbthrift",
    ],
)

rust_library(
    name = "mononoke_types-mocks",
    srcs = glob(["mocks/**/*.rs"]),
    autocargo = {
        "cargo_toml_dir": "mocks",
    },
    test_deps = ["//eden/mononoke/mononoke_macros:mononoke_macros"],
    deps = [
        "fbsource//third-party/rust:chrono",
        "fbsource//third-party/rust:lazy_static",
        ":mononoke_types",
    ],
)
